@extends('layouts.app')

@section('content')

    <el-row style="padding: 5px;">
        <el-row class="community-title">
            <el-row>楼栋信息：</el-row>
        </el-row>
        {{--小区描述--}}
        <el-row>
            <el-col>
                名称：@{{ buildingDetail.name }}
            </el-col>
            <el-col>
                描述：@{{ buildingDetail.description }}
            </el-col>
            <el-col>
                备注：@{{ buildingDetail.remarks }}
            </el-col>
        </el-row>
        <el-row class="community-title">
            <el-row>楼层列表：</el-row>
        </el-row>
        {{--楼层列表--}}
        <el-row>
            <el-row class="floor-list" v-for="(item, index) in floorList" :key="index">
                <el-col :span="4">@{{ item.floor_num }}</el-col>
                <el-col :span="20">
                    <el-button v-for="(room, i) in item.room"
                               :key="i"
                               size="mini"
                               @click="showRoomDetail(room)">@{{ room.room_num }}</el-button>
                    <el-button type="primary" size="mini" @click="roomAdd(item)">新增</el-button>
                </el-col>
            </el-row>
        </el-row>
    </el-row>

    <el-dialog
            title="房间信息"
            :visible.sync="dialog.isShow"
            width="90%">
        <el-form label-width="60px">
            <el-form-item label="楼层">
                <el-input v-model="roomDetail.floor_id" disabled></el-input>
            </el-form-item>
            <el-form-item label="房号">
                <el-input v-model="roomDetail.room_num"></el-input>
            </el-form-item>
            <el-form-item label="房名">
                <el-input v-model="roomDetail.name"></el-input>
            </el-form-item>
            <el-form-item label="面积">
                <el-input v-model="roomDetail.area"></el-input>
            </el-form-item>
            <el-form-item label="联系人">
                <el-input v-model="roomDetail.contact_name"></el-input>
            </el-form-item>
            <el-form-item label="电话">
                <el-input v-model="roomDetail.phone"></el-input>
            </el-form-item>
            <el-form-item label="状态">
                <el-radio-group v-model="roomDetail.status">
                    <el-radio label="已售"></el-radio>
                    <el-radio label="待售"></el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="描述">
                <el-input v-model="roomDetail.description"></el-input>
            </el-form-item>
            <el-form-item label="备注">
                <el-input v-model="roomDetail.remarks"></el-input>
            </el-form-item>
        </el-form>
        <el-row style="text-align:center;">
            <el-button type="primary" @click="roomSave" :disabled="dialog.disabled">保存</el-button>
        </el-row>
    </el-dialog>

    <el-button type="primary"
               @click="floorAdd"
               class="fix-button">新增楼层</el-button>
@endsection

@section('js')
    <script src="/js/building/detail.js"></script>
@endsection